package com.diy.sigmund.diyorder.feign.client;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diyorder.feign.fallback.FeignFallbackFactory;
import java.math.BigDecimal;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author ylm-sigmund
 * @since 2022/11/12 16:53
 */
@FeignClient(value = "diy-user", contextId = "SeataUserClient", fallbackFactory = FeignFallbackFactory.class)
public interface SeataUserClient {

    @RequestMapping("/user/seataUser/decreaseInventory")
    ResultMsg decreaseInventory(@RequestParam String commodityId, @RequestParam Integer transactionQuantity);

    @RequestMapping("/user/seataUser/decreaseAccount")
    ResultMsg decreaseAccount(@RequestParam String phone, @RequestParam BigDecimal transactionAmount);
}
